package com.jshoperxms.controller.utils.enums;

/**
 * Created by sdywcd on 17/1/5.
 * Des:购物车枚举
 */
public class MemberCartEnums {

    /**
     * 商品在购物车的状态
     */
    public enum MemberCartStatus{
        NEWADDTOCART_ONE_NUM("新加入购物车的商品", "1"), HAVE_DELETETOCART_TWO_NUM("从购物车中删除的商品", "2"), HAVE_ADDTOORDER_THREE_NUM("被加入订单的商品", "3");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private MemberCartStatus(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String tag) {
            for (MemberCartStatus d : MemberCartStatus.values()) {
                if (d.getState().equals(tag)) {
                    return d.getName();
                }
            }
            return "";
        }
    }
}
